import React from 'react';
import ReactDOM from 'react-dom';
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import {BrowserRouter, Route, Redirect, Switch } from 'react-router-dom'
import { createStore,applyMiddleware, compose} from 'redux'
import registerServiceWorker from './registerServiceWorker';
import './config'
import Layout from './Layout'
import './index.styl'
import { detail } from './detail.redux'
import Err from './err'

//store 赋值 加调试
const  store = createStore(detail, compose(
  applyMiddleware(thunk),
  window.devToolsExtension ? window.devToolsExtension() : f=>f
))
ReactDOM.render(
  <Provider store = {store}>
    <BrowserRouter>
      <div>
        <Route path='/' exact component={Layout}></Route>
        <Route path='/err' component={Err}></Route>
      </div>
    </BrowserRouter>
  </Provider>
,document.getElementById('root'));
registerServiceWorker();
